<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>{dede:field.title/}-{dede:global.cfg_webname/}</title>
		<meta name="keywords" content="{dede:field.keywords/}">
		<meta name="description" content="{dede:field.description function='html2text(@me)'/}">
		<link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css">
		<link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico">
		<script>const PHPURL = '{dede:field name="phpurl"/}';</script>
		<script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script>
		<script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script>
		<script>
			var shortname = "{dede:global.art_shortname/}";
			var npage = parseInt("{dede:field name = 'nowpage'/}");
			var totalpage = parseInt("{dede:field name = 'totalpage'/}");
			var namehand = "{dede:field name='namehand'/}";
			var displaytype = "{dede:field name='displaytype'/}";
			var gtimer = null;
			//大图
			function dPlayBig() {
				var imgObj = document.getElementById("bigimg");
				window.open(imgObj.src);
			}
			//停止幻灯
			function dStopPlay() {
				if (gtimer) clearTimeout(gtimer);
				else dPlayNext();
			}
			//开始幻灯
			function dStartPlay() {
				if (npage != totalpage) {
					gtimer = setTimeout("dPlayNext()", 1000);
				}
			}
			//上一张
			function dPlayPre() {
				if (npage < 2) {
					ShowMsg("这是第一页");
				} else {
					if (npage == 2) {
						if (namehand != '') location.href = namehand + shortname;
						else location.href = "/apps/view.php?aid={dede:field name='id'/}";
					} else if (displaytype == 'st' && namehand != '') {
						location.href = namehand + "-" + (npage - 1) + shortname;
					} else {
						location.href = "/apps/view.php?aid={dede:field name='id'/}&pageno=" + (npage - 1);
					}
				}
			}
			//下一张
			function dPlayNext() {
				if (npage == totalpage) {
					ShowMsg("没有了哦");
			} 	else {
					if (displaytype == 'st' && namehand != '') location.href = namehand + "-" + (npage + 1) + shortname;
					else location.href = "/apps/view.php?aid={dede:field name='id'/}&pageno=" + (npage + 1);
				}
			}
		</script>
	</head>
	<body class="body-bg">
		{dede:include filename='top.htm'/}
		{dede:include filename='head.htm'/}
		<div class="container py-3">
			<div class="row">
				<div class="col-md-12">	
					<nav aria-label="breadcrumb">
						<ol class="breadcrumb mb-0">
							<li class="breadcrumb-item">当前位置</li>
							{dede:field name='position'/}
						</ol>
					</nav>
				</div>
			</div>
		</div>
		<main class="container py-3">
			<div class="row">
				<div class="col-md-9">
					<div class="article-main bg-white shadow-sm rounded p-3">
						<h2>{dede:field.title/}</h2>
						<div class="article-meta">
							<span><img src="{dede:field.face/}" class="user-img-xs mr-1">{dede:field.uname/}</span>
							<span><i class="fa fa-calendar mr-1"></i>{dede:field.pubdate function="MyDate('Y-m-d',@me)"/}</span>
							<span><i class="fa fa-globe mr-1"></i>{dede:field.source/}</span>
							<span><i class="fa fa-eye mr-1"></i><script src="{dede:field name='phpurl'/}/count.php?/apps/view=yes&aid={dede:field name='id'/}&mid={dede:field name='mid'/}"></script>次</span>
						</div>
						<div class="picbox py-3">
							{dede:field name='pagestyle' alt='输出不同的图片头信息' runphp='yes'}
							if (@me==3) {
								@me = '<div class="row">';
							} else if (@me==2) {
								@me = "<div class='text-center mb-3'>
									<a href='javascript:dPlayBig();' class='btn btn-success btn-sm'>原图片</a>
									<a href='javascript:dPlayPre();' class='btn btn-success btn-sm'>上一张</a>
									<a href='javascript:dPlayNext();' class='btn btn-success btn-sm'>下一张</a>
									<a href='javascript:dStopPlay();' class='btn btn-success btn-sm'>自动/暂停播放</a>
								</div>";
							} else {
								@me = '';
							}
							{/dede:field}
								<!--如果使用的是多页单图模式幻灯，把href里的链接改为javascript:dPlayNext();表示点击看下一页-->
								{dede:field name='imgurls' alt='输出不同的图片信息'}
								[field:pagestyle runphp='yes'] @me= (@me==3 ? '<div class="col-4">' : '');[/field:pagestyle]
								<p><a href='[field:linkurl/]'><img src='[field:imgsrc/]' [field:imgwidth/] id='bigimg' alt='[field:alttext/]' title='[field:alttext/]'></a></p>
								<p class='text-center'><a href='[field:linkurl/]'>（[field:alttext/]）</a></p>
								[field:pagestyle runphp='yes'] @me = (@me==3 ? '</div>' : ''); [/field:pagestyle]
								{/dede:field}
							{dede:field name='pagestyle' alt='输出不同的图片尾信息' runphp='yes'}
							if (@me==3) {
								@me = '</div>';
							} else if (@me==2) {
								@me = "<script>dStartPlay();</script>";
							} else {
								@me = '';
							}
							{/dede:field}
						</div>
						<div class="py-3">{dede:field.body/}</div>
						<div class="py-3">作者：{dede:adminname/}</div>
						<div class="py-3 row">
							<div class="col-md-4 prenext">
								<div class="pagination-previous mb-3">{dede:prenext get='pre'/}</div>
								<div class="pagination-next">{dede:prenext get='next'/}</div>
							</div>
							<div class="col-md-8">
								<div class="row actbox">
									<ul>
										<li><i class="fa fa-star-o mr-2"></i><a href="{dede:field name='phpurl'/}/stow.php?aid={dede:field.id/}" target="_blank">收藏</a></li>
										<li><i class="fa fa-bug mr-2"></i><a href="javascript:ErrorAddSave({dede:field.id/}, '{dede:field.title/}');">挑错</a></li>
										<li><i class="fa fa-thumbs-o-up mr-2"></i><a href="{dede:field name='phpurl'/}/recommend.php?aid={dede:field.id/}" target="_blank">推荐</a></li>
										<li><i class="fa fa-print mr-2"></i><a href="javascript:;" onclick="window.print();">打印</a></li>
									</ul>
								</div>
							</div>
						</div>
						{dede:include filename='widget_article_likes.htm'/}
						{dede:include filename='widget_article_feedback.htm'/}
					</div>
				</div>
				<div class="col-md-3">
					<div class="pb-3">{dede:include filename='widget_search.htm'/}</div>
					<div class="py-3">{dede:include filename='widget_menu.htm'/}</div>
					<div class="pt-3">{dede:include filename='widget_hot.htm'/}</div>
				</div>
			</div>
		</main>
		{dede:include filename='foot.htm'/}
	</body>
</html>